//
//  OpenFileViewController.m
//  lvfj
//
//  Created by lvfeijun on 2021/8/16.
//  Copyright © 2021 Goudu KuaiEx Technology(Shenzhen)Co.,ltd. All rights reserved.
//

#import "OpenFileViewController.h"
#import "QLPreviewController.h"

@interface OpenFileViewController ()<QLPreviewControllerDelegate,QLPreviewControllerDataSource>

@end

@implementation OpenFileViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

-(void)openFile{
    QLPreviewController *preViewController = [[QLPreviewController alloc] init];
    preViewController.delegate = self;
    preViewController.dataSource = self;
    preViewController.title = filename;
    __weak typeof(vc) tempVc = vc;
    [self presentViewController:preViewController animated:YES completion:^{
        
    }];
}
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller {
    return 1;
}

- (id<QLPreviewItemf>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index {
    QLPreviewItem *item = QLPreviewItem.new;
    item,url = [NSURL URLWithString:@"路径"];
    item.title = @"标题";
    return item;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
